<%@page import="com.test.bean.Player"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑运动员</title>
</head>
<body>
<%
   Object message = request.getAttribute("message");
   if(message != null){
%>
  <br/>
  <font color="red"><%=message %></font>
  <br/>
<% 	   
   }
   String id = null;
   String oldname = null;
   String name = null;
   String team = null;
   String city = null;
   
   Player player = (Player)request.getAttribute("player");
   if(player != null){
	   id = player.getID()+"";
	   name = player.getName();
	   team = player.getTeam();
	   city = player.getCity();
   }else{
	   id = request.getParameter("id");
	   oldname = request.getParameter("oldName");
	   team = request.getParameter("team");
	   city = request.getParameter("city");
   }
%>
<form action="update.do" method="post">
   <input type="hidden" id="ID" name = "id" value = "<%=player.getID() %>"/>
    <input type="hidden" id="oldName"  name="oldName" value = "<%=player.getName() %>"/>
   <table>
      <tr>
         <td>姓名:</td>
         <td><input type="text" name="name"
         value="<%=player.getName() %>"/></td>
      </tr>
       <tr>
         <td>球队:</td>
         <td><input type="text" name="team"
         value="<%=player.getTeam()%>"/></td>
      </tr>
       <tr>
         <td>城市:</td>
         <td><input type="text" name="city"
         value="<%=player.getCity()%>"/></td>
      </tr>
       <tr>
         <td colspan="3"><input type="submit" value="提交" style="width: 64px"/></td>
      </tr>
      
   
   </table>

</form>
</body>
</html>